public class VoltageAdapter implements VoltageOutput {

    public VoltageAdapter(ACPowerSource inputPower) {
        this.ac220Input = inputPower;
    }

    public VoltageAdapter() {}

    private ACPowerSource ac220Input;

    @Override
    public int outPut5V() {
        int adapterInput = this.ac220Input.outPutVoltage();
        int adapterOutput = adapterInput / 44;

        System.out.println("转换完成，输出电压为：" + adapterOutput);

        return adapterOutput;
    }

    @Override
    public int outPut12() {
        int adapterInput = this.ac220Input.outPutVoltage();
        int adapterOutput = adapterInput / 18;
        return adapterOutput;
    }

    @Override
    public int outPut24() {
        return 0;
    }

    public ACPowerSource getAc220Input() {
        return ac220Input;
    }

    public void setAc220Input(ACPowerSource ac220Input) {
        this.ac220Input = ac220Input;
    }
}